home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / test / suplib / getcwd.c < prev    next >
C/C++ Source or Header  |  1992-10-25  |  233b  |  19 lines

  1.  
  2. #include <stdlib.h>
  3. #include <libc.h>
  4. #include <sys/param.h>
  5.  
  6. char *
  7. getcwd(char *buf, int maxlen)
  8. {
  9.     char xbuf[MAXPATHLEN];
  10.  
  11.     if (getwd(xbuf)) {
  12.     strncpy(buf, xbuf, maxlen);
  13.     return(buf);
  14.     } else {
  15.     return(NULL);
  16.     }
  17. }
  18.  
  19.